window: Don't set a background pattern/colour when client decorated
authorRob Bradford <rob@linux.intel.com>
Tue, 19 Feb 2013 19:26:19 +0000 (19:26 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 17 Mar 2013 16:13:35 +0000 (12:13 -0400)
Otherwise we'll potentially get some background sticking through our rounded
corners in our decorations. The actual background will get drawn as part of
the decoration drawing.

gtk/gtkwindow.c

index 98ef7e55bdb373f960b61e709b2974528edbf17e..bc14900baf9de26798123b4752de8f1905cf19a3 100644 (file)
@@ -5315,7 +5315,11 @@ gtk_window_realize (GtkWidget *widget)
       gtk_widget_set_window (widget, gdk_window);
       gtk_widget_register_window (widget, gdk_window);
 
-      gtk_style_context_set_background (gtk_widget_get_style_context (widget), gdk_window);
+      /* We don't need to set a background on the GdkWindow; with decorations
+       * we draw the background ourself
+       */
+      if (!priv->client_decorated)
+        gtk_style_context_set_background (gtk_widget_get_style_context (widget), gdk_window);
 
       return;
     }
@@ -5393,9 +5397,14 @@ gtk_window_realize (GtkWidget *widget)
 
   gtk_widget_register_window (widget, gdk_window);
 
-  context = gtk_widget_get_style_context (widget);
-  gtk_style_context_set_background (context, gdk_window);
-
+  /* We don't need to set a background on the GdkWindow; with decorations
+   * we draw the background ourself
+   */
+  if (!priv->client_decorated)
+    {
+      context = gtk_widget_get_style_context (widget);
+      gtk_style_context_set_background (context, gdk_window);
+    }
 
   if (priv->transient_parent &&
       gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent)))